<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/dmhxq.css" />
		<link rel="stylesheet" type="text/css" href="css/zytop.css" />
		<link rel="stylesheet" type="text/css" href="css/zyfooter.css" />
		<style type="text/css">
			.qglist {
				display: none;
			}
			
			.qgtitle:hover .qglist {
				display: block;
			}
			
			#qg {
				border-bottom: 2px solid black;
			}
			/*头部样式*/
			/*内容*/
		</style>
	</head>

	<body>
		<div id="qg">
			<div id="index_topbar">
				<div class="content">
					<p class="welcome">欢迎来到黑科技</p>
					<div class="menu">
						<a target="_blank" href="javascript:;" class="item">帮助中心</a>
						<span class="divi">|</span>
						<a href="javascript:;" class="item">我的订单</a>
						<span class="divi">|</span>
						<a id="gouwuche" class="item">购物车</a>
						<span class="divi">|</span>
						<a target="_blank" href="javascript:;" class="item">APP下载</a>
						<span class="divi">|</span>
						<a target="_blank" href="javascript:;" class="item">校园招聘</a>
					</div>
					<div class="login">
						<a href="javascript:;" class="link">登录</a>
						<span class="divi">|</span>
						<a href="javascript:;" class="link">注册</a>
					</div>
				</div>
			</div>
			<!--top结束-->
			<div id="index_header">
				<a class="logo" href="javascript:;">
					<img src="img/zhuye/logo.jpg" />
				</a>
				<a class="slogan" href="javascript:;">
					<img src="img/zhuye/slogan1.png" />
				</a>
				<div id="searchbar">
					<span class="name">热门搜索:</span>
					<a href="javascript:;" class="item">小米</a>
					<div style="clear: both;"></div>
					<div class="searchinput">
						<input type="text" id="input" value="iphone6s 32GB" />
						<a href="javascript:;" id="btn">搜索</a>
					</div>
					<div style="clear: both;"></div>
					<a href="javascript:;" class="item">红米4</a>
					<a href="javascript:;" class="item">红米4A</a>
					<a href="javascript:;" class="item">三星s7edge</a>
					<a href="javascript:;" class="item">苹果7</a>
				</div>
			</div>
			<!--searchbar结束-->
			<div id="index_menu">
				<h2 class="title qgtitle">全部商品分类
					<ul class="list qglist">
					<li>
						<h2 class="phone1">手机专区</h2>
				<div class="phonelist">
					<p>
						<a href="javascript:;">华为</a>
						<a href="javascript:;">苹果</a>
						<a href="javascript:;">三星</a>
						<a href="javascript:;">oppo</a>
					</p>
					<p>
						<a href="javascript:;">vivo</a>
						<a href="javascript:;">荣耀</a>
						<a href="javascript:;">魅族</a>
						<a href="javascript:;">小米</a>
					</p>
				</div>
				<div class="box">
					<div style="overflow: hidden;">
						<a target="_blank" href="javascript:;" class="item">苹果 iPhone 7</a>
						<a target="_blank" href="javascript:;" class="item">苹果 iPhone 7plus</a>
						<a target="_blank" href="javascript:;" class="item">苹果 iPhone 6s</a>
					</div>
					<ul>
						<li>
							<p class="kind">特色手机</p>
							<div class="nav">
								<a href="javascript:;">精品推荐</a>
								<a href="javascript:;">最新机型</a>
								<a href="javascript:;">热销千元</a>
								<a href="javascript:;">双卡双待</a>
								<a href="javascript:;">个性潮机</a>
								<a href="javascript:;">老人最爱</a>
							</div>
						</li>
						<div style="clear: both;"></div>
						<li>
							<p class="kind">价格区间</p>
							<div class="nav">
								<a href="javascript:;">1-499</a>
								<a href="javascript:;">500-999</a>
								<a href="javascript:;">1000-1999</a>
								<a href="javascript:;">2000-2999</a>
								<a href="javascript:;">3000-3999</a>
								<a href="javascript:;">4000-4999</a>
								<a href="javascript:;">5000以上</a>
							</div>
						</li>
						<div style="clear: both;"></div>
						<li>
							<p class="kind">网络制式</p>
							<div class="nav">
								<a href="javascript:;">4G全网通</a>
								<a href="javascript:;">移动联通双4G</a>
								<a href="javascript:;">移动4G</a>
								<a href="javascript:;">联通4G</a>
								<a href="javascript:;">电信4G</a>
								<a href="javascript:;">电信3G</a>
								<a href="javascript:;">2G（移动2G/联通2G）</a>
							</div>
						</li>
					</ul>
				</div>
				</li>
				<li>
					<h2 class="phone2">智能专区</h2>
					<div class="phonelist">
						<p>
							<a href="javascript:;">智能手表</a>
							<a href="javascript:;">智能手环</a>
							<a href="javascript:;">智能眼镜</a>
						</p>
						<p>
							<a href="javascript:;">智能机器人</a>
							<a href="javascript:;">无人机</a>
							<a href="javascript:;">投影仪</a>
						</p>
					</div>
					<div class="box">
						<div style="overflow: hidden;">
							<a target="_blank" href="javascript:;" class="item">苹果 iPhone 7</a>
							<a target="_blank" href="javascript:;" class="item">苹果 iPhone 7plus</a>
							<a target="_blank" href="javascript:;" class="item">苹果 iPhone 6s</a>
						</div>
						<ul>
							<li>
								<p class="kind">智能手表</p>
								<div class="nav">
									<a href="javascript:;">华为</a>
									<a href="javascript:;">小米</a>
									<a href="javascript:;">唯动</a>
									<a href="javascript:;">乐心</a>
									<a href="javascript:;">幻响</a>
								</div>
							</li>
							<div style="clear: both;"></div>
							<li>
								<p class="kind">智能手环</p>
								<div class="nav">
									<a href="javascript:;">华为</a>
									<a href="javascript:;">摩托罗拉</a>
									<a href="javascript:;">小天才</a>
									<a href="javascript:;">三星</a>
									<a href="javascript:;">一米</a>
									<a href="javascript:;">葫芦娃</a>
									<a href="javascript:;">ticwatch</a>
								</div>
							</li>
							<div style="clear: both;"></div>
							<li>
								<p class="kind">vr眼镜</p>
								<div class="nav">
									<a href="javascript:;">幻影</a>
									<a href="javascript:;">暴风魔镜</a>
								</div>
							</li>
							<div style="clear: both;"></div>
							<li>
								<p class="kind">智能机器人</p>
								<div class="nav">
									<a href="javascript:;">小鱼在家</a>
									<a href="javascript:;">爱乐优</a>
									<a href="javascript:;">阿尔法</a>
								</div>
							</li>
							<div style="clear: both;"></div>
							<li>
								<p class="kind">无人机</p>
								<div class="nav">
									<a href="javascript:;">拍若特</a>
								</div>
							</li>
						</ul>
					</div>
				</li>
				<!---->
				<li>
					<h2 class="phone3">手机配件</h2>
					<div class="phonelist">
						<p>
							<a href="javascript:;">贴膜</a>
							<a href="javascript:;">保护套</a>
							<a href="javascript:;">电源</a>
							<a href="javascript:;">充电器</a>
						</p>
						<p>
							<a href="javascript:;">数据线</a>
							<a href="javascript:;">蓝牙耳机</a>
							<a href="javascript:;">手机耳机</a>
						</p>
					</div>
					<div class="box">
						<div style="overflow: hidden;">
							<a target="_blank" href="javascript:;" class="item">苹果 iPhone 7</a>
							<a target="_blank" href="javascript:;" class="item">苹果 iPhone 7plus</a>
							<a target="_blank" href="javascript:;" class="item">苹果 iPhone 6s</a>
						</div>
						<ul>
							<li>
								<p class="kind">熱搜配件</p>
								<div class="nav">
									<a href="javascript:;">保护套</a>
									<a href="javascript:;">移动电源</a>
									<a href="javascript:;">钢化膜</a>
									<a href="javascript:;">耳机</a>
									<a href="javascript:;">数据线</a>
									<a href="javascript:;">内存卡</a>
								</div>
							</li>
							<div style="clear: both;"></div>
							<li>
								<p class="kind">保护类</p>
								<div class="nav">
									<a href="javascript:;">手机壳</a>
									<a href="javascript:;">手机贴膜</a>
								</div>
							</li>
							<div style="clear: both;"></div>
							<li>
								<p class="kind">电源类</p>
								<div class="nav">
									<a href="javascript:;">充电线</a>
									<a href="javascript:;">充电宝</a>
									<a href="javascript:;">车充</a>
								</div>
							</li>
							<li>
								<p class="kind">音频类</p>
								<div class="nav">
									<a href="javascript:;">蓝牙耳机</a>
									<a href="javascript:;">运动耳机</a>
									<a href="javascript:;">入耳耳机</a>
									<a href="javascript:;">小米耳机</a>
									<a href="javascript:;">华为耳机</a>
									<a href="javascript:;">无线蓝牙耳机</a>
									<a href="javascript:;">音响</a>
								</div>
							</li>
							<li>
								<p class="kind">品牌推荐</p>
								<div class="nav">
									<a href="javascript:;">品胜</a>
									<a href="javascript:;">小米</a>
									<a href="javascript:;">闪迪</a>
									<a href="javascript:;">飞毛腿</a>
									<a href="javascript:;">三星</a>
									<a href="javascript:;">洛克</a>
								</div>
							</li>
						</ul>
					</div>
				</li>
				<li>
					<h2 class="phone4">平板专区</h2>
					<div class="phonelist">
						<p>
							<a href="javascript:;">华为</a>
							<a href="javascript:;">苹果</a>
							<a href="javascript:;">三星</a>
							<a href="javascript:;">小米</a>
						</p>
					</div>
					<div class="box">
						<div style="overflow: hidden;">
							<a target="_blank" href="javascript:;" class="item">苹果 iPhone 7</a>
							<a target="_blank" href="javascript:;" class="item">苹果 iPhone 7plus</a>
							<a target="_blank" href="javascript:;" class="item">苹果 iPhone 6s</a>
						</div>
						<ul>
							<li>
								<p class="kind">热门品牌</p>
								<div class="nav">
									<a href="javascript:;">苹果</a>
									<a href="javascript:;">小米</a>
									<a href="javascript:;">三星</a>
									<a href="javascript:;">华为</a>
								</div>
							</li>
							<div style="clear: both;"></div>
							<li>
								<p class="kind">价格区间</p>
								<div class="nav">
									<a href="javascript:;">3000-3999</a>
									<a href="javascript:;">4000-4999</a>
									<a href="javascript:;">5000以上</a>
								</div>
							</li>
							<div style="clear: both;"></div>
							<li>
								<p class="kind">搜索热门</p>
								<div class="nav">
									<a href="javascript:;">苹果 ipad pro</a>
									<a href="javascript:;">苹果 ipad pro2</a>
									<a href="javascript:;">苹果ipad mini</a>
								</div>
							</li>
						</ul>
					</div>
				</li>
				</ul>
				</h2>
				<ul class="menu">
					<li>
						<a href="index.html">首页</a>
					</li>
					<li>
						<a href="dmhshop.html">手机商城</a>
					</li>
					<li>
						<a href="peijianzhongxing.html">配件专区</a>
					</li>
					<li>
						<a href="zy_shangpin.html" style="color: #EA4235 ;">黑科技</a>
					</li>
					<li>
						<a href="qianggou.html">限时抢购</a>
					</li>
					<li>
						<a href="zy_help.html">帮助中心</a>
					</li>
				</ul>
				<div style="clear: both;"></div>

			</div>
		</div>
		<!--头部-->
		<div class="clear">
        <!--内容-->
		</div>
		<div id="xq_big">
			<div id="xq_main">
				<div id="xq_a">
					<h3></h3>
					<p></p>
					<div id="xq_aa">
						<div id="xq_aa_le">
							<div class="xq_imgbox">
								<img />
							</div>
							<ul id="xq_ula">
								<li class="red"><img /></li>
								<li><img /></li>
								<li><img /></li>
								<li><img /></li>
								<li><img /></li>
							</ul>
							<p><span>关注商品</span></p>
							<p>商品编号：<span></span></p>
						</div>
						<div id="xq_aa_ri">
							<div id="xq_ri_a">
								<sapn class="xq_spa">促销价</sapn><span class="xq_spb"></span><span class="xq_spc"></span><span class="xq_spd"></span><span class="xq_spe"></span><span class="xq_spg">对比</span><span class="xq_spf"></span>
							</div>
							<div id="xq_ri_b">
								<span>促销</span><span>送积分</span>购买即送<span></span>积分
							</div>
							<div id="xq_ri_c">
								<div>购物保障</div>
								<ul>
									<li title="会员购买商品免邮费">
										<span>邮</span> 免邮费
									</li>
									<li title="尊享全国门店售后服务">
										<span>售</span> 售后服务
									</li>
									<li title="支持发票随商品一同送达">
										<span>票</span> 货票同行
									</li>
									<li title="人格担保权威正品">
										<span>正</span> 正品保证
									</li>
									<li title="享受全国联保服务">
										<span>保</span> 全国联保
									</li>
								</ul>
							</div>
							<div id="xq_ri_d">
								<p><span>发货时间</span> 当天16：00前下单 18：00后发货，16：00后下单第二天发货（部分商品可能会有延迟）</p>
								<p><span>送货时间</span> 预计2-3天（新疆、西藏、港澳台等地区除外）</p>
								<p><span>心服务</span>闪电退换、返店交通补助、服务投诉奖励</p>
							</div>
							<div id="xq_ri_e">
								<div class="xq_ri_ea">
									<span>选择颜色</span>
									<ul>
									</ul>
								</div>
								<div class="xq_ri_eb">
									<span>选择容量</span>
									<ul>
										<li class="dianji"></li>
									</ul>
								</div>
								<div class="xq_ri_ec">
									<span>选择制式</span>
									<ul>
										<li class="dianji"></li>
									</ul>
								</div>
								<div class="xq_ri_ed">
									<span>购买数量</span>
									<div>
										<input type="button" id="jian" value="-" />
										<div id="val">1</div><input type="button" id="jia" value="+" />
									</div>
								</div>
							</div>
							<div id="xq_ri_f">
								<div id="shop" class="dianji">立即购买</div>
								<div id="add">加入购物车</div>
								<div id="ziti">门店自提</div>
							</div>
						</div>
						<div class="clear">

						</div>
					</div>
				</div>
				<div id="xq_b">
					<div>
						<span>商品详情</span>
						<span>立即购买</span>
					</div>
					<div>

					</div>
				</div>
			</div>
			<div class="footer">
				<div class="footer_div1">
					<div class="footer_div1_top">
						<a href="javascript:;"><img src="img/footer/fuwu01.jpg" width="256" height="97" class="_top_a"></a>
						<a href="javascript:;"><img src="img/footer/fuwu02.jpg" width="214" height="97" class="_top_a"></a>
						<a href="javascript:;"><img src="img/footer/fuwu03.jpg" width="205" height="97" class="_top_a"></a>
						<a href="javascript:;"><img src="img/footer/fuwu04.jpg" width="254" height="97" class="_top_a"></a>
						<a href="javascript:;"><img src="img/footer/fuwu05.jpg" width="237" height="97" class="_top_a"></a>
					</div>
					<div class="clear"></div>
					<div class="footer_div1_bottom">
						<dl class="footer_div1_bottom_left">
							<dt>购物指南</dt>
							<dd>
								<a href="javascript:;">购物流程</a>
							</dd>
							<dd>
								<a href="javascript:;">会员介绍</a>
							</dd>
							<dd>
								<a href="javascript:;">常见问题</a>
							</dd>
							<dd>
								<a href="javascript:;">联系客服</a>
							</dd>
						</dl>
						<dl class="footer_div1_bottom_left">
							<dt>支付方式</dt>
							<dd>
								<a href="javascript:;">快捷支付</a>
							</dd>
							<dd>
								<a href="javascript:;">分期付款</a>
							</dd>
							<dd>
								<a href="javascript:;">货到付款</a>
							</dd>
							<dd>
								<a href="javascript:;">门店支付</a>
							</dd>
						</dl>
						<dl class="footer_div1_bottom_left">
							<dt>物流配送</dt>
							<dd>
								<a href="javascript:;">到店自提</a>
							</dd>
							<dd>
								<a href="javascript:;">送货上门</a>
							</dd>
							<dd>
								<a href="javascript:;">物流查询</a>
							</dd>
						</dl>
						<dl class="footer_div1_bottom_left">
							<dt>售后服务</dt>
							<dd>
								<a href="javascript:;">退换货流程</a>
							</dd>
							<dd>
								<a href="javascript:;">退款说明</a>
							</dd>
							<dd>
								<a href="javascript:;">退换货申请</a>
							</dd>
							<dd>
								<a href="javascript:;">预约维修</a>
							</dd>
						</dl>
						<dl class="footer_div1_bottom_left">
							<dt>心服务</dt>
							<dd>
								<a href="javascript:;">投诉奖励</a>
							</dd>
							<dd>
								<a href="javascript:;">交通补助</a>
							</dd>
							<dd>
								<a href="javascript:;">十大免费</a>
							</dd>
						</dl>
						<div class="footer_div1_bottom_right">
							<div class="footer_div1_bottom_right_img"><img src="img/footer/quanguomendian_icon.png"></div>
							<strong id="footer_str_strong">身边黑科技</strong>
							<p id="p_p1">全国300个城市3000家门店为您提供最贴心的服务！</p>
							<div id="btn_n1"></div>
						</div>
						<div class="clear"></div>
					</div>

				</div>
				<div id="footer_last">
					<div class="footer_div2">
						<div id="footer_div2_top">
							<ul id="footer_div2_ul">
								<li>
									<a href="javascript:;">关于我们</a>
								</li>
								<li>
									<a href="javascript:;">联系我们</a>
								</li>
								<li>
									<a href="javascript:;">品牌专区</a>
								</li>
								<li>
									<a href="javascript:;">友情链接</a>
								</li>
								<li>
									<a href="javascript:;">迪粉社区</a>
								</li>
								<li id="lis">
									<a href="javascript:;">投诉建议</a>
								</li>
							</ul>
							<div class="clear"></div>
							<p>全国服务热线：400-700-8800 </p>
							<p>商务合作: jiaxiao@dixintong.com</p>
							<p id="last_p">Powered by DiXinTong©2001-2015京ICP备11010605号©2001-2015 DiXinTong Inc. 北京黑科技商贸股份有限公司</p>
						</div>
						<div id="erweima">
							<div id="ewm-z">
							</div>
							<div id="ewm_y">
								<p class="p1">黑科技客户端</p>
								<p class="p2">移动生活，私人订制</p>
								<div id="btn_n2">APP下载</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script src="js/av-min-2.1.2.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/gouwuche.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			//获取商品
			//市场价
			var scj;
			var currentUser; //判断当前用户
			var isnew; //判断该商品是否已被录入购物车
			var color = "" //记录商品颜色
			$(function(){
				init();
				gengxin();
				currentUser = AV.User.current();      //判断用户是否登录
				panduan();
			});
				//截取url参数

			function getUrlItem(name) {
				var url = location.search
				start = url.indexOf(name + "=")
				if(start != -1) {
					start = start + name.length + 1
					c_end = url.indexOf("&", start)
					if(c_end == -1) c_end = url.length
					return unescape(url.substring(start, c_end))
				}
				return '';
			}

			//更新数据
			function gengxin() {
				var num1 = getUrlItem("id");
				query = new AV.Query('zhuyun');
				query.equalTo("bianhao", num1);
				query.find().then(function(results) {
					console.log(results);
					$("#xq_a>h3").html(results[0].attributes.Title);
					$("#xq_a>p").html(results[0].attributes.Guanggao);
					$(".xq_imgbox").find("img").attr("src", results[0].attributes.img[0]);
					$("#xq_ula img").each(function(i) {
						$(this).attr("src", results[0].attributes.img[i]);
					});
					$("#xq_aa_le p:last-of-type").find("span").html(results[0].attributes.bianhao);
					$(".xq_spb").html("￥" + results[0].attributes.cxj[0]);
					$(".xq_spc").html("直降" + (results[0].attributes.yuanjia - results[0].attributes.cxj[0]) + ".00");
					$(".xq_spd").html("市场价：￥" + results[0].attributes.yuanjia);
					scj = results[0].attributes.yuanjia;
					$(".xq_spe").html("销量：" + parseInt(Math.random() * 100));
					$(".xq_spf").html("共" + parseInt(Math.random() * 9000 + 1000) + "人查看");
					//积分
					$("#xq_ri_b span:last-of-type").html(parseInt(results[0].attributes.cxj[0]));
					//颜色
					for(var i = 0; i < results[0].attributes.color.length; i++) {
						var $li = $("<li jg=" + results[0].attributes.cxj[i] + ">" + results[0].attributes.color[i] + "</li>");
						$(".xq_ri_ea ul").append($li);
					}
					//容量
					if(results[0].attributes.memory) {
						$(".xq_ri_eb li").html(results[0].attributes.memory);
					} else {
						$(".xq_ri_eb li").html("如图");
					}

					if(results[0].attributes.style) {
						$(".xq_ri_ec li").html(results[0].attributes.style);
					} else {
						$(".xq_ri_ec li").html("如图");
					}
					//制式
					//图文介绍
					$("#xq_b div:last-of-type").html(results[0].attributes.miaoshu);
				});
			}
			//楼层
			$("#xq_ula li").mouseover(function() {
					$("#xq_ula li").removeClass("red");
					$(this).addClass("red");
					$(".xq_imgbox").html($(this).html());
				})
				//选择款式点击
			$("#xq_ri_e li").click(function() {
				$(this).parent().find("li").removeClass("dianji");
				$(this).addClass("dianji");
			})
			$("#xq_ri_e ul:eq(0)").on("click", "li", function() {
				$(this).parent().find("li").removeClass("dianji");
				$(this).addClass("dianji");
					color = $(this).html()
				console.log(color) //记录选择的颜色
				$(".xq_spb").html("￥" + $(this).attr("jg"));
				$("#xq_ri_b span:last-of-type").html(parseInt($(this).attr("jg")));
				$(".xq_spc").html("直降" + (scj - parseInt($(this).attr("jg"))) + ".00");
			})

			//购物点击
			$("#xq_ri_f div").click(function() {
					$("#xq_ri_f div").removeClass("dianji");
					$(this).addClass("dianji");
				})
				//购买加减
			$("#jia,#jian").click(function() {
				var $num = eval($("#val").html() + $(this).val() + 1);
				if($num > 0 && $num < 9) {
					$("#val").html($num);
				}
			});
			function getPageUrl() {
				var index = location.pathname.lastIndexOf("/") //获取当前页面
				var ret = location.pathname.substr(index + 1) + location.search
				return escape(ret)
			};
		</script>
	</body>

</html>